package com.leyou.privilege.mapper;

import com.leyou.common.mapper.BaseMapper;
import com.leyou.privilege.entity.Application;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *
 * @author: wangzibeng
 * Date: 2019/5/16 0016
 * Time: 11:59
 */

@Repository
public interface ApplicationMapper extends BaseMapper<Application> {
    /**
     * 新增服务权限信息
     *
     * @param appId        应用id
     * @param targetIdList 可访问的目标服务id集合
     * @return 新增的影响次数
     */
    int insertApplicationPrivilege(@Param("appId") Long appId, @Param("targetIdList") List<Long> targetIdList);

    /**
     * 查询权限的集合
     *
     * @param id APPId
     * @return 权限集合
     */
    List<Long> queryTargetIdListByAppId(@Param("id") Long id);
}
